package com.tj.collection.enums;

/**
 * Author: Karl
 * Date: 2020/12/17 6:24 下午
 */
public enum ClUserEducationEnum {
    UNKNOWN(0, "Unknown"),
    BELOW_HIGH_SCHOOL(1, "Below High School"),
    HIGH_SCHOOL(2, "High School"),
    BACHELOR(3, "Bachelor"),
    MASTER(4, "Master"),
    DOCTOR(5, "Doctor");
    private Integer type;
    private String desc;

    ClUserEducationEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public ClUserEducationEnum setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public ClUserEducationEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static ClUserEducationEnum getEnum(Integer type) {
        for (ClUserEducationEnum enumObj : ClUserEducationEnum.values()) {
            if (enumObj.getType().equals(type)) {
                return enumObj;
            }
        }
        return null;
    }
}
